package com.lsm.sm.action;

import javax.annotation.Resource;

import org.apache.commons.lang.xwork.StringUtils;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.lsm.sm.service.StudentService;
import com.lsm.sm.util.Const;
import com.lsm.sm.util.WebUtil;

@Controller("studentAction")
@Scope("prototype")
public class StudentAction {
	
	
	private String courseInfo;
	private String message;
	
	@Resource
	private StudentService studentService;
	
	public String getcorse(){
		try {
			
		} catch (Exception e) {
			
		}
		return null;
	}

	public String signIn(){
		try {
			if( StringUtils.isBlank( courseInfo ) ){
				studentService.signIn();
			}else{
				studentService.signIn( courseInfo );
			}
			
			setMessage( WebUtil.dealRespsMsg( Const.RSPS_MSG_006 ) );
		} catch (Exception e) {
			setMessage( WebUtil.dealException( e ) );
		}
		return Const.RST_SIGNIN;
	}
	
	public String getCourseInfo(){
		return this.courseInfo;
	}
	
	public void setCourseInfo(String courseInfo) {
		this.courseInfo = courseInfo;
	}
	
	public String getMessage() {
		return message;
	}
	
	public void setMessage(String message) {
		this.message = message;
	}
}
